/* Copyright 203-2115 AtomWare Technology Pty Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * The flowing information must be keep 
 * DataViewAction.java
 * business
 * 2013-1-7上午11:49:41
 * @author 屈甲康
 * QQ285799123
 * mailto:qujiakang@gmail.com
 */

package org.jackysoft.struts2.business;

import java.util.Collection;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.entity.ArmDailyProductReporter;
import org.jackysoft.entity.Department;
import org.jackysoft.entity.MonthPlanning;
import org.jackysoft.report.EmptyReport;
import org.jackysoft.service.ArmDailyReporterService;
import org.jackysoft.service.ArmMonthlyPlanService;


@Namespace("/views")
public class DataViewAction extends ReporterCRUDAction<EmptyReport> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2664464995999263679L;
	private ArmMonthlyPlanService planService;
	private ArmDailyReporterService dailyService;
	private Department department;	
	private ArmDailyProductReporter  report;
	private Collection<MonthPlanning> plans;

	public String viewreport() throws Exception {
	    
		report = dailyService.get(
				usedate.getYear()
				,usedate.getMonthOfYear()
				,usedate.getDayOfMonth()
				,department);
		
		return "viewreport";
	
	}

	public String viewplan() throws Exception {
	    	
		plans = planService.find(year, month,department);
		
		return "viewplan";
	
	}

	public ArmMonthlyPlanService getPlanService() {
		return planService;
	}

	@Resource
	public void setPlanService(ArmMonthlyPlanService planService) {
		this.planService = planService;
	}

	public ArmDailyReporterService getDailyService() {
		return dailyService;
	}

	@Resource
	public void setDailyService(ArmDailyReporterService dailyService) {
		this.dailyService = dailyService;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public ArmDailyProductReporter getReport() {
		return report;
	}

	public void setReport(ArmDailyProductReporter report) {
		this.report = report;
	}

	public Collection<MonthPlanning> getPlans() {
		return plans;
	}

	public void setPlans(Collection<MonthPlanning> plans) {
		this.plans = plans;
	}
}
